home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / share / aclocal / openobex.m4 < prev    next >
M4 Source File  |  2006-01-09  |  2KB  |  57 lines

  1. dnl Check for openobex library
  2. dnl Written by Pontus Fuchs 2000-08-18
  3. dnl Version checking fixed by Christian W. Zuckschwerdt 2002-10-17
  4.  
  5. AC_DEFUN([AM_PATH_OPENOBEX], [
  6.     AC_PATH_PROG(OPENOBEX_CONFIG, openobex-config, no)
  7.  
  8.     if test "$OPENOBEX_CONFIG" = "no" ; then
  9.         AC_MSG_ERROR(openobex-config not found. Pehaps openobex is not installed.)
  10.     fi
  11.  
  12.     min_obex_version=ifelse([$1], ,0.9.6,$1)
  13.     AC_MSG_CHECKING(for openobex - version >= $min_obex_version)
  14.  
  15.     OPENOBEX_CFLAGS=`$OPENOBEX_CONFIG --cflags`
  16.     OPENOBEX_LIBS=`$OPENOBEX_CONFIG --libs`
  17.  
  18.     obex_config_version=`$OPENOBEX_CONFIG --version`
  19.  
  20.     obex_config_major_version=`$OPENOBEX_CONFIG --version | \
  21.         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  22.     obex_config_minor_version=`$OPENOBEX_CONFIG --version | \
  23.         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  24.     obex_config_micro_version=`$OPENOBEX_CONFIG --version | \
  25.         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  26.  
  27.     obex_req_major_version=`echo $min_obex_version | \
  28.         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  29.     obex_req_minor_version=`echo $min_obex_version | \
  30.         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  31.     obex_req_micro_version=`echo $min_obex_version | \
  32.         sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  33.  
  34.  
  35.     if test $obex_req_major_version -lt $obex_config_major_version ; then
  36.                obex_config_version_ok="yes"
  37.            fi
  38.     if test $obex_req_major_version -eq $obex_config_major_version ; then
  39.         if test $obex_req_minor_version -lt $obex_config_minor_version ; then
  40.                    obex_config_version_ok="yes"
  41.                fi
  42.         if test $obex_req_minor_version -eq $obex_config_minor_version ; then
  43.             if test $obex_req_micro_version -le $obex_config_micro_version ; then
  44.                 obex_config_version_ok="yes"
  45.             fi
  46.         fi
  47.     fi
  48.     
  49.     if test "$obex_config_version_ok" != "yes" ; then
  50.         AC_MSG_ERROR(Installed openobex library too old ($obex_config_version))
  51.     fi
  52.  
  53.     AC_SUBST(OPENOBEX_CFLAGS)
  54.     AC_SUBST(OPENOBEX_LIBS)
  55.     AC_MSG_RESULT(yes)
  56. ])
  57.